#!/bin/bash

set -e

VSCODE_DATA_PATH="/var/lib/vscode-devel"
VSCODE_ROOT_PATH="${VSCODE_DATA_PATH}/root"
mkdir -p $VSCODE_ROOT_PATH

VSCODE_EXTENSIONS_PATH="$VSCODE_ROOT_PATH/.vscode-server/extensions"
mkdir -p $VSCODE_EXTENSIONS_PATH
cp -rfv container-data/prune_unused_extensions.py $VSCODE_EXTENSIONS_PATH

# 拷贝配置文件
cp -rfv etc/pip.conf /etc/pip.conf
cp -rfv etc/bashrc  $VSCODE_ROOT_PATH/.bashrc
cp -rfv etc/gitconfig $VSCODE_ROOT_PATH/.gitconfig
cp -rfv etc/tmux.conf $VSCODE_ROOT_PATH/.tmux.conf
cp -rfv etc/profile $VSCODE_ROOT_PATH/.profile

docker compose up -d
